﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorkflowWizart.Lib.Utility.Costants;

namespace WorkflowWizart.Lib.Entities.WorkflowEntities
{
    /// <summary>
    /// Item in workflow like method
    /// </summary>
    public class ContainerWorkflowItem :WorkflowItem
    {

        public ContainerWorkflowItem()
        {
            this.ChildItems = new List<WorkflowItem>();
            this.Conditions = new List<WorkflowItem>();
        }

        public void AddChildItem(WorkflowItem child)
        {
            child.ParentItem = this;
            this.ChildItems.Add(child);
        }

        public void AddConditionItem(WorkflowItem condition)
        {
            condition.ParentItem = this;
            this.Conditions.Add(condition);
        }

        public void RemoveChildItem(WorkflowItem child)
        {
            child.ParentItem = null;
            ChildItems.Remove(child);
        }

        public void RemoveConditionItem(WorkflowItem condition)
        {
            condition.ParentItem = null;
            ChildItems.Remove(condition);
        }

        /// <summary>
        /// items under this workflow item.
        /// </summary>
        public List<WorkflowItem> ChildItems { get; set; }


        /// <summary>
        /// items under this workflow item.
        /// </summary>
        public List<WorkflowItem> Conditions { get; set; }
        

    }
}
